object-curly-spacing#21
Conversation
Require a space at the start and end of objects.
Valid:
```js
var obj = {};
var obj = { 'foo': 'bar' };
var obj = { 'foo': { 'bar': 'baz' }, 'qux': 'quxx' };
var obj = {
'foo': 'bar'
};
var { x } = y;
import { foo } from 'bar';
```
Invalid
```js
var obj = {'foo': 'bar'};
var obj = {'foo': 'bar' };
var obj = { baz: {'foo': 'qux'}, bar};
var obj = {baz: { 'foo': 'qux' }, bar};
var obj = {'foo': 'bar'
};
var obj = {
'foo':'bar'};
var {x} = y;
import {foo } from 'bar';
```
|
What about arrays? |
|
And this is a major change, standard would be bumped to v6. |
|
AFAIK this is already meant to be enforced, if this isn't the case, it's a bug IIRC. |
|
Reference standard/standard#182, this is out lined as what we expected. @feross looks good to me? Merge? |
|
I know there is the even spacing rule at the moment, however it can mean that you aren't consistent across all objects in all files. var x = { y: 42 }
var z = {p: 24}This for example, would be valid at the moment. I just feel that it should be consistent spacing across everything. |
|
Ah, that is the key point of difference. |
|
Yeah, this is a big breaking change. We investigated how easy it would be to make things consistent across a single file, but it wasn't easy. In the future, I'm hoping we can just pick |
|
@feross where were those stats again? |
|
I ran it a while ago. I can re-run, but I know it's going to be too high (double digit percentages) to get into |
|
Continue conversation @ Object curlies: File/project–wide or standard? |
Require a space at the start and end of objects.
Valid:
Invalid